package lib

import (
	"RMS/app/shop/model"
	"RMS/common"
	"RMS/common/db"
	"context"
	"log"
)

func ImplDeleteTable(ctx context.Context, req *model.DeleteTableReq) *model.DeleteTableResp {
	resp := &model.DeleteTableResp{}
	d := db.NewRmsDBRequest(ctx)
	d = d.Table(db.PmsTable)
	if err := d.Delete(req).Error; err != nil {
		log.Printf("DeleteTable err := %v", err.Error())
		resp.Status = common.ErrCode
		resp.Message = common.DelErrMessage
		return resp
	}
	resp.Status = common.SuccessCode
	resp.Message = common.SuccessMessage
	return resp
}
